(function (jquery,window) {
    $.extend({
        SetCookie:function (name, value, day, path, domain, secure) {
            var strCookie = "";
            if (name) {
                strCookie += encodeURIComponent(name) + "=" + encodeURIComponent(value);
                //将中文转码
            }
            if (typeof (day) == "number") {
                var date = new Date();
                date.setDate(date.getDate() + day);
                strCookie += ";expires=" + date;
            }
            if (path) {
                strCookie += ";path=" + path;
            }
            if (domain) {
                strCookie += ";domain=" + domain;
            }
            if (secure) {
                strCookie += ";secure";
            }
            return document.cookie = strCookie;
        },
        getCookie:function(name) {
        var str = document.cookie;
        var arr = str.split(";");
        for (var i = 0; i < arr.length; i++) {
            var temarr = arr[i].split("=");
            if (decodeURIComponent(temarr[0].trim()) == name) {
                //将前面转码的中文重新转为中文
                return decodeURIComponent(temarr[1]);
            }
        }
        return "";
    },
        removeCookie:function(name) {
        SetCookie(name, "", -1);
    }
})
})(jQuery,window)